using Redbrick.Silverlight.Common;
namespace Moria.Common.Model
{
    internal class Set
    {

        public static bool IsRoom(FloorType element)
        {
            if ((element == FloorType.DarkFloor) || (element == FloorType.LightFloor))
                return (true);
            return (false);
        }

		  public static bool IsCorridor(FloorType element)
        {
            if (element == FloorType.Corridor || element == FloorType.BlockedFloor)
                return (true);
            return (false);
        }

		  public static bool IsFloor(FloorType element)
        {
            if (element <= FloorType.MaxCaveFloor)
                return (true);
            else
                return (false);
        }

		  public static bool corrodes(InventoryItem item)
        {
            switch (item.Type)
            {
                case ItemType.SWORD:
                case ItemType.HELM:
                case ItemType.SHIELD:
                case ItemType.HARD_ARMOR:
                case ItemType.WAND:
                    return (true);
            }
            return (false);
        }

		  public static bool flammable(InventoryItem item)
        {
            switch (item.Type)
            {
                case ItemType.ARROW:
                case ItemType.BOW:
                case ItemType.HAFTED:
                case ItemType.POLEARM:
                case ItemType.BOOTS:
                case ItemType.GLOVES:
                case ItemType.CLOAK:
                case ItemType.SOFT_ARMOR:
                    return !(item.Flags.Has(ItemFlag.RES_FIRE));
                case ItemType.STAFF:
                case ItemType.SCROLL1:
                case ItemType.SCROLL2:
                    return true;
            }
            return (false);
        }

		  public static bool frost_destroy(InventoryItem item)
        {
            if ((item.Type == ItemType.POTION1) || (item.Type == ItemType.POTION2)
                 || (item.Type == ItemType.FLASK))
                return (true);
            return (false);
        }

		  public static bool acid_affect(InventoryItem item)
		{
			switch (item.Type)
			{
				case ItemType.MISC:
				case ItemType.CHEST:
					return true;
				case ItemType.BOLT:
				case ItemType.ARROW:
				case ItemType.BOW:
				case ItemType.HAFTED:
				case ItemType.POLEARM:
				case ItemType.BOOTS:
				case ItemType.GLOVES:
				case ItemType.CLOAK:
				case ItemType.SOFT_ARMOR:
					return !item.Flags.Has( ItemFlag.ResistAcid);
			}
			return (false);
		}

		  public static bool lightning_destroy(InventoryItem item)
        {
            if ((item.Type == ItemType.RING) || (item.Type == ItemType.WAND)
                 || (item.Type == ItemType.SPIKE))
                return (true);
            else
                return (false);
        }

		 public static bool Null(InventoryItem item)
        {
            return (false);
        }

		  public static bool acid_destroy(InventoryItem item)
        {
            switch (item.Type)
            {
                case ItemType.ARROW:
                case ItemType.BOW:
                case ItemType.HAFTED:
                case ItemType.POLEARM:
                case ItemType.BOOTS:
                case ItemType.GLOVES:
                case ItemType.CLOAK:
                case ItemType.HELM:
                case ItemType.SHIELD:
                case ItemType.HARD_ARMOR:
                case ItemType.SOFT_ARMOR:
                    return !item.Flags.Has(ItemFlag.ResistAcid);
                case ItemType.STAFF:
                case ItemType.SCROLL1:
                case ItemType.SCROLL2:
                case ItemType.FOOD:
                case ItemType.OPEN_DOOR:
                case ItemType.CLOSED_DOOR:
                    return (true);
            }
            return (false);
        }

		  public static bool fire_destroy(InventoryItem item)
        {
            switch (item.Type)
            {
                case ItemType.ARROW:
                case ItemType.BOW:
                case ItemType.HAFTED:
                case ItemType.POLEARM:
                case ItemType.BOOTS:
                case ItemType.GLOVES:
                case ItemType.CLOAK:
                case ItemType.SOFT_ARMOR:
                    return (item.Flags.Has(ItemFlag.RES_FIRE));
                case ItemType.STAFF:
                case ItemType.SCROLL1:
                case ItemType.SCROLL2:
                case ItemType.POTION1:
                case ItemType.POTION2:
                case ItemType.FLASK:
                case ItemType.FOOD:
                case ItemType.OPEN_DOOR:
                case ItemType.CLOSED_DOOR:
                    return (true);
            }
            return (false);
        }

		  public static  bool general_store(ItemType element)
        {
            switch (element)
            {
                case ItemType.DIGGING:
                case ItemType.BOOTS:
                case ItemType.CLOAK:
                case ItemType.FOOD:
                case ItemType.FLASK:
                case ItemType.LIGHT:
                case ItemType.SPIKE:
                    return (true);
            }
            return (false);
        }

		  public static  bool armory(ItemType element)
        {
            switch (element)
            {
                case ItemType.BOOTS:
                case ItemType.GLOVES:
                case ItemType.HELM:
                case ItemType.SHIELD:
                case ItemType.HARD_ARMOR:
                case ItemType.SOFT_ARMOR:
                    return (true);
            }
            return (false);
        }

		  public static  bool weaponsmith(ItemType element)
        {
            switch (element)
            {
                case ItemType.SLING_AMMO:
                case ItemType.BOLT:
                case ItemType.ARROW:
                case ItemType.BOW:
                case ItemType.HAFTED:
                case ItemType.POLEARM:
                case ItemType.SWORD:
                    return (true);
            }
            return (false);
        }

		  public static  bool temple(ItemType element)
        {
            switch (element)
            {
                case ItemType.HAFTED:
                case ItemType.SCROLL1:
                case ItemType.SCROLL2:
                case ItemType.POTION1:
                case ItemType.POTION2:
                case ItemType.PRAYER_BOOK:
                    return (true);
            }
            return (false);
        }

		  public static  bool alchemist(ItemType element)
        {
            switch (element)
            {
                case ItemType.SCROLL1:
                case ItemType.SCROLL2:
                case ItemType.POTION1:
                case ItemType.POTION2:
                    return (true);
            }
            return (false);
        }

		  public static bool magic_shop(ItemType element)
        {
            switch (element)
            {
                case ItemType.AMULET:
                case ItemType.RING:
                case ItemType.STAFF:
                case ItemType.WAND:
                case ItemType.SCROLL1:
                case ItemType.SCROLL2:
                case ItemType.POTION1:
                case ItemType.POTION2:
                case ItemType.MAGIC_BOOK:
                    return (true);
            }
            return (false);
        }

    }
}